package com.huawei.appgallery.game.impl;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import o.cle;
import o.cln;
import o.ContentManager;
import o.ll;

public class GameResourceSwitchReceiver extends SafeBroadcastReceiver {
    private static GameResourceSwitchReceiver ˊ = new GameResourceSwitchReceiver();

    public void onReceiveMsg(Context context, Intent intent) {
        if ("com.huawei.appgallery.updatemanger.autoupdate.ACTION_NOTIFY_SWITCH_STATUS".equals(intent.getAction())) {
            cle.ˎ.ˋ("GameResourcePreLoad", "notifySwitchStatus");
            if (!intent.getBooleanExtra("isSwitchOn", true)) {
                cln.ॱ(false);
            }
        }
    }

    public static void register() {
        Context ˋ = ContentManager.getInstant().getContext();
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("com.huawei.appgallery.updatemanger.autoupdate.ACTION_NOTIFY_SWITCH_STATUS");
        ll.ˏ(ˋ).ˏ(ˊ, intentFilter);
    }

    public static void unregister() {
        ll.ˏ(ContentManager.getInstant().getContext()).ˋ(ˊ);
    }
}
